{include file="public/header" /}
<title>管理员管理</title>
</head>
<body>
	<article class="page-container">
		<form class="form form-horizontal" id="form-admin-add" method="post">
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>oem_id：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.oem_id}" id="oem_id" name="oem_id" placeholder="所属oem_id">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>应用场景：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" value="{$data.id}" id="id" name="id" style="display: none;">
					<input type="text" class="input-text" value="{$data.title}" id="title" name="title" placeholder="应用场景">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>短信分类：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<select name="type" class="form-control" id="type">
						<option value="1" {if $data.type==1}selected{/if}>验证码</option>
						<option value="2" {if $data.type==2}selected{/if}>短信通知</option>
						<option value="3" {if $data.type==3}selected{/if}>推广短信</option>
						<option value="4" {if $data.type==4}selected{/if}>语音通知</option>
						<option value="5" {if $data.type==5}selected{/if}>群发助手</option>
					</select>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>短信签名：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.sign_name}" id="sign_name" name="sign_name" placeholder="短信签名">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>模板ID：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.tid}" id="tid" name="tid" placeholder="模板ID">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>模板参数：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.params}" id="params" name="params" placeholder="模板参数">
				</div>
			</div>

			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<input class="btn btn-primary radius" id='tijiao' type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</article>
	{include file="public/footer" /}
	<script type="text/javascript">
		$(function() {
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});

			$('#tijiao').click(function() {
				$.ajax({

					type: 'post',
					data: {
						id: $('#id').val(),
						title: $('#title').val(),
						type: $('#type option:selected').val(),
						sign_name: $('#sign_name').val(),
						tid: $('#tid').val(),
						params: $('#params').val(),
						oem_id:$('#oem_id').val()
					},
					url: "{:url('SmsTemplate/update')}",
					success: function(data) {
						layer.msg('修改成功!', {
							icon: 1,
							time: 1000
						}, function() {
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name);
							parent.layer.close(index);
						});

					},
					error: function(XmlHttpRequest, textStatus, errorThrown) {
						layer.msg('修改失败!', {
							icon: 1,
							time: 1000
						});
					}
				});
			});
		});
	</script>